Managing data with Toolbox
5 Tasks
30 mins
Scenario
The Robotic Banking company acquires the Pega Finance webpage that offers the Online Bill Pay system. All customer transactions in the Pega Finance system move to the Robot Banking company BankerInsight application for record consolidation.
The Robotic Banking company offers a discount to Pega Finance customers who have already signed up and created an account in BankerInsight before the system update. The automation adds a 20% discount to all Pega Finance invoices from the acquisition period and assigns the deal to the BankerInsight account.
Complete the following tasks:
- Create an automation that finds Pega Finance customers with the account number corresponding to the BankerInsight account.
- Create an automation that retrieves the invoice data.
- Compare the invoice data with the discount period.
- Concatenate bonus memo and invoice ID to use as a transaction description.
- Create an automation that applies a 20% discount with proper description to the BankerInsight application.
Detailed Tasks
1 Create the Finance_CustomerSearch automation.
Create an automation that loops through the Pega Finance customer list and selects the customer of the given account number. The account number is an input parameter of the automation.
- Download the Robotic Banking project:
Managing data with Toolbox - Start.zip (443.75 KB)
- Save the file to your desktop and unzip the file to extract the project folder to your C:\Users\<username>\Documents\Pega Robot Studio\Projects\.
- On the Home screen in Pega Robot Studio, click Open Project, and then navigate to the projects folder and open Robotic Banking.pegaproject.
Note: The starter project includes a configured BankerInsight application. The value of the Path field must match the location of BankerInsight on your local computer for the project to function properly. In the BankerInsight application, change the value of the Path to the location of your BankerInsight application.
- In theFinance_CustomerSearch automation. , click to open the
- Add the following design blocks to the automation surface:
Design block name Actions Connections PerformClick method - On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining, and then drag the lnkCustomers control to the automation surface.
- In the Select action dialog box, click More.
- In the search field, enter PerformClick.
- On the Method tab, select the PerformClick (no parameters) method and then click Add.
- Automation link: Entry Point - PerformClick.
WaitForCreate method - On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining, and then drag the tblAccounts control to the automation surface.
- In the Select action dialog box, click More.
- In the search field, enter WaitForCreate.
- On the Method tab, select the WaitForCreate (no parameters) method and then click Add.
- Automation link: PerformClick - WaitForCreate.
- Automation link: WaitForCreate > Result > False - Jump To Error (Customer table unavailable).
GetClones method - On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > tblAccounts, and then drag the trAccounts control to the automation surface.
- In the Select action dialog box, click More.
- In the search field, enter GetClones.
- On the Method tab, select the method and then click Add.
- Automation link: WaitForCreate > Result > False - GetClones.
ListLoop - On the Toolbox tab, in the search field, enter ListLoop.
- Drag the ListLoop component to the automation surface.
- Automation link: GetClones - ListLoop.
- Data link: GetClones > Result - ListLoop - List.
- Automation link: ListLoop > Completed - Jump To Error (Customer not found).
Text property - On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > tblAccounts > trAccounts, and then drag the tdAccountNum control to the automation surface.
- In the Select action dialog box, click More.
- In the search field, enter Text.
- On the Property tab, select the checkbox for the Text property and then click Add(1).
- Automation link: ListLoop > ItemYielded - tdAccountNum.
Equals method - In the Toolbox, expand the Data handling > Strings > Compare folder.
- Drag the Equals method to the automation surface.
- Automation link: tdAccountNum - Equals.
- Data link: tdAccountNum > Text - Equals > string1.
accountNumber local variable - On the Palette, expand Locals > Run.
- Drag the accountNumber variable to the automation surface.
- Data link: accountNumber - Equals > string2.
ListLoop Break method - On the Palette, expand the Locals section, and drag the ListLoop to the automation surface.
- In the Select action dialog box, click and in the search field enter Break.
- On the Method tab, select Break and then click Add.
- Automation link: Equals > Result > True - Break.
PerformClick method - On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > tblAccounts > trAccounts, and then drag the lnkAccountName control to the automation surface.
- In the Select action dialog box, click More.
- In the search field, enter PerformClick.
- On the Method tab, select the method PerformClick (no parameters) and then click Add.
- Automation link: Break - lnkAccountName.
- Automation link: lnkAccountName - Jump To Exit.
- Connect the design blocks as shown in the following figure:
- On the toolbar, click Save to save the automation.
Verify the step
- In the BillPaySystemDiscount automation. , click and open
- In the upper-right corner, click the button to run the automation.
- On the Testing automation dialog box, in the accountNumber input field, enter 4, and then click .
- Verify that Test complete window is displayed with the errMessage parameter set to Customer not found.
2 Create the Finance_GetInvoiceData automation.
Create an automation that selects the customer's invoice, retrieves invoice data (invoice number, date, amount, and memo), and adds it as a Lookup Table record.
- In the Finance_GetInvoiceData automation. , click and open
- On the Palette, click Applications, and then select Show hidden items.
- Add the following design blocks to the automation surface:
Design block name Action Connections GetClones method - On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > cntrInvoices> tblInvoices, and then drag the trInvoices control to the automation surface.
- In the Select action dialog box, click More.
- In the search field, enter GetClones.
- On the Method tab, select the method and then click Add.
- Automation link: WaitForCreate > Result > True - trInvoices.
ListLoop component - In the Toolbox search field, enter ListLoop.
- Drag the ListLoop component to the automation surface.
- Automation link: GetClones - ListLoop.
- Data link: GetClones > Result - ListLoop > List.
- Automation link: ListLoop > Completed - Jump To Exit.
PerformClick method - On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > cntrInvoices> tblInvoices > trInvoices and then drag the lnkInvoice control to the automation surface.
- In the Select action dialog box, click More.
- In the search field, enter PerformClick.
- On the Method tab, select the PerformClick (no parameters) method and then click Add.
- Automation link: ListLoop > ItemYielded - PerfomrClick.
- Automation link: PerformClick - WaitForCreate.
AddRecord method - On the Palette tab, expand the Globals section and then drag the Invoice Lookup Table to the automation surface.
- In the Select action dialog box, click More.
- In the search field, enter AddRecord.
- On the Method tab, select the method and then click Add.
- Automation link: WaitForCreate > Result > True - AddRecord.
- Automation link: AddRecord - WaitForEvent.
Text properties - On the Palette tab, click Applications > Pega Finance > PegaRoboticsTraining > frmInvoices, and then drag the txtInvoiceNumber control to the automation surface.
- In the Select action dialog box, click More.
- In the search field, enter Text.
- On the Property tab, select the checkbox for Text property and then click Add.
- Repeat steps a-d to add text property for the following controls: txtInvoiceDate, txtInvoiceAmount, txtInvoiceMemo.
- Data Link: txtInvoiceNumber - AddRecord > key_invoiceNumber.
- Data link: txtInvoiceDate - AddRecord > transactionDate.
- Data link: txtInvoiceAmount - AddRecord > transactionAmount.
- Data link: txtInvoiceMemo - AddRecord > invoiceMemo.
- Connect the design blocks as shown in the following figure:
- On the toolbar, click Save to save the automation.
Verify the step
- In the BillPaySystemDiscount automation. , click and open
- In the upper-right corner, click the button to run the automation.
- On the Testing automation dialog box, in the accountNumber input field, enter 73001, and then click .
- Verify that Test complete window is displayed with the errMessage parameter set to Selected customer has no invoices.
3 Verify the system move date
Create an automation that retrieves the invoice date and compares it with the discount deadline date. The discount deadline is a global variable that determines the invoices that are needed to proceed.
- In the , select and open the CompareDate automation.
- Add the following design blocks to the automation surface:
Design block name Action Connections GetRecord method - On the Palette tab, under the Globals folder, drag the Invoice lookup table to the automation surface.
- In the Select action dialog box, select the GetRecord method, and then click Add.
- Automation link: Entry point - GetRecord.
- Automation link: GetRecord > Result > False - Jump To Error (Failed to get record from the lookup table).
Value property - In the Palette, expand Globals and drag the invoiceNumber variable to the automation surface.
- In the Select action window, select Value property and then click Add.
- Data link: invoiceNumber > Value - GetRecord.
TryParse method - In the Toolbox, navigate to the Data Handling > Dates > Convert folder.
- In the Convert folder, drag the TryParse method onto the automation surface.
- Automation link: GetRecord > Result > True - TryParse.
- Data link: GetRecord > transactionDate - TryParse > value.
- Automation link: TryParse > Result > False - Jump To Error (Failed to parse invoice date).
Compare method - In the Toolbox, expand the Data Handling > Dates > Compare folder.
- Drag the Compare method to the automation surface.
- Automation link: TryParse > Result > True - Compare.
- Data link: TryParse > result - Compare > date1.
- Data link: discountDeadlineDate - Compare > date2.
- Automation link: Compare > Result > Before - Jump To Exit.
- Automation link: Compare > Result > Equal - Jump To Exit.
- Automation link: Compare > Result > After - Jump To Error (Invoice date is after deadline).
- On the automation surface, connect the links, as shown in the following figure:
- On the toolbar, click Save to save the automation.
4 Update the invoice description
Create an automation that concatenates the invoice's number and bonus memo and saves it in a global variable to be used as a bonus transaction description.
- In the Project Explorer, click and open the ConcatenateInvoice automation.
- Add the following design blocks to the automation surface:
Design block name Action Connections Concat method - In the Toolbox, in the search box, enter Concat, and then drag the Concat method onto the automation surface.
- Automation link: Entry Point - Concat.
bonusMemo Value property - In the Toolbox, expand the Variables section and drag the String variable to the automation surface.
- On the design block, double-click String1 and then enter bonusMemo.
- On the design block, click Value, and then enter Robotic banking discount for invoice number:
- Data link: bonusMemo - Concat > list0.
invoiceNumber Value property - In the Palette, expand Globals and drag invoiceNumber variable to the automation surface.
- In the Select action window, select Value property and then click Add.
- Data link: invoiceNumber - Concat > list1.
invoiceDescription Value property - In the Palette, expand the Globals section and drag invoiceDescription global variable to the auotmation surface.
- In the Select action window, select Value property and then click .
- Automation link: Concat - invoiceDecription.
- Data link: Concat > Result - invoiceDescription.
- Automation link: invoiceDescription - Jump To Exit.
- In the Toolbox, in the search box, enter Concat, and then drag the Concat method onto the automation surface.
- On the automation surface, connect the links, as shown in the following figure:
- On the toolbar, click Save to save the automation.
5 Calculate discount
Create an automation that calculates a bonus of 20% of a customer's invoice amount for a user that signed up for the BankerInsight account.
- In the Project Explorer, click and open CalculateInvoiceDicount automation.
- Add the following design blocks to the automation surface:
Design block name Action Connections GetRecord method - On the Palette tab, under the Globals folder, drag the Invoice lookup table to the automation surface.
- In the Select action dialog box, select the GetRecord method, and click Add.
- Automation link: Entry Point - GetRecord.
- Automation link: GetRecord > Result > False - Jump To Error (Failed to get record from lookup table)
Value property - In the Palette, expand Globals and drag invoiceNumber variable to the automation surface.
- In the Select action window, select Value property and then click Add.
- Data link: invoiceNumber - GetRecord > Key_invoiceNumber.
Replace method - In the Toolbox, in the search box, enter Replace, and then drag the Replace method of the string category onto the automation surface.
- Hard code the oldValue parameter by clicking on it and typing a $ symbol. Click on the newValue, hit the space bar, and then click on the automation surface which will hard code the newValue as a blank string.
- Automation link: GetRecord > Result > False - Replace.
- Data link: GetRecord > transactionAmount - Replace > stringValue.
dblAmount variable - On the Toolbox, open the Variables folder, and then drag double variable onto the automation surface.
- On the design block, double-click Double1 and change the name of variable to dblAmount.
TryParse method - On the Palette tab, in the Locals section, drag the dblAmount variable onto the automation surface.
- In the Select action dialog box, click More, enter try in the search box, select the TryParse method, and then click Add.
- Automation link: Replace - TryParse.
- Data link: Replace > Result - TryParse > input.
- Automation link: TryParse > Result > False - Jump To Error (Failed to parse invoice data)
NumericExpression component - In the Toolbox, expand the Workflow > Expressions section.
- Drag the NumericExpression component onto the automation surface.
- Click inside the NumericExpression block, and then enter a*b.
- Automation link: TryParse > Result > True - NumericExpression.
- Data link: dblAmount > Value - NumericExpression > a.
- Data link: 20PercentDiscount - NumericExpression > b.
- Automation link: NumericExpression - Jump To Exit.
calculatedAmount global variable - On the Palette tab, in the Globals section, drag the calculatedAmount variable onto the automation surface.
- In the Select action dialog box, select the Value property, and then click .
- Data link: NumericExpression > result - calculatedAmount.
- On the automation surface, connect the links, as shown in the following figure:
- On the toolbar, click Save to save the automation.
Confirm your work
- In the Project Explorer, click and open BillPaySystemDiscount.
- On the right-upper corner of Pega Robot Studio, click the Test button to run the automation test.
- In the Testing automation dialog box, enter 40932 and then click Test.
- Wait till automation completes, and a Test complete dialog box will be displayed.
- On the Test complete dialog box, verify that automation ends with the Result equals True.
- On the dialog box, click Done.
- Display the BankerInsight application.
- Click the Account Types tab.
- Verify that new transactions are added in the Transaction History section.
- Close the BankerInsight application.
Available in the following mission:
Want to help us improve this content?